//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.tool.picasso;

import android.graphics.Bitmap;
import com.squareup.picasso.Transformation;

public class CropSquareTransformation implements Transformation {
    public CropSquareTransformation() {
    }

    public Bitmap transform(Bitmap source) {
        int size = Math.min(source.getWidth(), source.getHeight());
        int x = (source.getWidth() - size) / 2;
        int y = (source.getHeight() - size) / 2;
        Bitmap result = Bitmap.createBitmap(source, x, y, size, size);
        if(result != source) {
            source.recycle();
        }

        return result;
    }

    public String key() {
        return "square()";
    }
}
